package com.niit.mall.cart.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.niit.mall.cart.domain.po.Cart;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

/**
 * <p>
 * 购物车 Mapper 接口
 * </p>
 *
 * @author ChuXuan
 * @since 2025-05-26
 */
@Mapper
public interface CartMapper extends BaseMapper<Cart> {

	@Update("update tb_cart set quantity = quantity + 1 where product_id = #{productId} and user_id = #{userId}")
	void updateNum(@Param("productId") Long productId, @Param("userId") Long userId);
}
